<?php
namespace app\admin\validate;
use think\Validate;

class Content extends Validate
{
    
    protected $rule = [
        'type'      =>  'require|in:1,2',
        'toolid'    =>  'require|number',
        'content'   =>  'require',
    ];

    protected $message = [
        'type.require'      => '内容分类参数不能为空!',
        'type.in'           => '内容分类参数错误!',
        'toolid.require'    => '工具ID参数不能为空!',
        'toolid.number'     => '工具ID参数错误!',
        'content.require'   => '内容不能为空!',
    ];

    protected $scene = [
        'edit'         =>  ['type','toolid','content'],
        'info'         =>  ['type','toolid'],
    ];

}